var service_common = require("common.js");

//对外公开的方法
module.exports = {
  autoUpgradeDaShi: autoUpgradeDaShi,
  helpUpgradeDaShi: helpUpgradeDaShi
}

/**
 * 自动升级大使
 */
function autoUpgradeDaShi(cb) {
  service_common.fetchData(
    service_common.getUrl("user.setAutoUpgradeDaShi"),
    {
      openid: getApp().globalData.openid
    },
    function (res) {
      cb(res);
    },
    "GET"
  )
}

function helpUpgradeDaShi(openid, cb) {
  service_common.fetchData(
    service_common.getUrl("user.getHelpUpgradeDaShi"),
    {
      from_openid: getApp().globalData.openid,
      shang_ji_openid: getApp().globalData.openid,
      openid: openid
    },
    function (res) {
      cb(res);
    },
    "GET"
  )
}
